package com.citycloud.ccuap.tc.yq.resultsymbol;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.citycloud.ccuap.commons.application.Application;
import com.citycloud.ccuap.framework.service.mybatis.MybatisServiceImpl;
import com.citycloud.ccuap.tc.yq.constant.YqConstant;
import com.citycloud.ccuap.tc.yq.entity.SysResultSymbol;
import com.citycloud.ccuap.tc.yq.repository.SysResultSymbolRepository;

/**
 * 海搜结果结果中过滤-符号业务处理实现
 * @author sufeng
 *
 */
@Service
public class ResultSymbolService extends MybatisServiceImpl<SysResultSymbolRepository, SysResultSymbol, String> implements IResultSymbolService {

    @Autowired
    ResultSymbolMapper resultSymbolMapper;

    @Override
    public List<SysResultSymbol> cykaBlyat() {
        return resultSymbolMapper.cykaBlyat("SQL", "93ACB46B-228F-48FA-BA95-D66F3A0F5AA0");
    }
    
    @Override
	public void loadDataToMemory() {
		Map<String, SysResultSymbol> map = new HashMap<String, SysResultSymbol>(16);
		
		List<SysResultSymbol> list = selectList();
		if (list != null) {
			for (SysResultSymbol sysResultSymbol : list) {
				map.put(sysResultSymbol.getObjId(), sysResultSymbol);
			}
		}
		Application.setAttribute(YqConstant.RESULT_SYMBOL_KEY, map);
	}
}